@echo off
chcp 65001

echo "公司代码once执行开始(新once)"
set http_proxy=http://127.0.0.1:7890 & set https_proxy=http://127.0.0.1:7890
echo "http_proxy:%http_proxy%  https_proxy:%https_proxy%"

REM 获取当前日期（格式：YYYYMMDD）
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "datetime=%%a"
set "log_date=%datetime:~0,4%%datetime:~4,2%%datetime:~6,2%"

set "PROJECT_DIR=D:/crypto_quant"
cd /d "%PROJECT_DIR%"
set PYTHONPATH=D:/crypto_quant;%PYTHONPATH%

echo "1: weekly_get_exchange_trading_volume"
python ./TQR_Applications/windows_jobs/app/weekly_get_exchange_trading_volume.py >> D:/crypto_quant/logs/weekly_get_exchange_trading_volume_%log_date%.txt 2>&1

echo "2: weekly_get_exchange_margin_interest_rate"
python ./TQR_Applications/windows_jobs/app/weekly_get_exchange_margin_interest_rate.py >> D:/crypto_quant/logs/weekly_get_exchange_margin_interest_rate_%log_date%.txt 2>&1

echo "3: weekly_get_funding_rate_data"
python ./TQR_Applications/windows_jobs/app/weekly_get_funding_rate_data.py >> D:/crypto_quant/logs/weekly_get_funding_rate_data_%log_date%.txt 2>&1

echo "4: calc trading_data_update"
python ./TQR_Applications/factor_database/crypto/trading_data_update.py >> D:/crypto_quant/logs/weekly_trading_data_update_%log_date%.txt 2>&1

echo "5: calc trading_data 1weeks"
python ./TQR_Applications/factor_database/crypto/trading_data_weeks.py >> D:/crypto_quant/logs/trading_data_weeks_%log_date%.txt 2>&1

echo "6: all_drawdown_ratio"
python ./TQR_Applications/windows_jobs/app/weekly_whole_market_analysis.py >> D:/crypto_quant/logs/weekly_whole_market_analysis_%log_date%.txt 2>&1

echo "7: weekly_get_valuation_percentile"
python ./TQR_Applications/windows_jobs/app/weekly_get_valuation_percentile.py >> D:/crypto_quant/logs/weekly_get_valuation_percentile_%log_date%.txt 2>&1

echo "8: weekly_get_cex_spot_volume_maxdrawdown"
python ./TQR_Applications/windows_jobs/app/weekly_get_cex_spot_volume_maxdrawdown.py >> D:/crypto_quant/logs/weekly_get_cex_spot_volume_maxdrawdown_%log_date%.txt 2>&1

echo "9: weekly_get_cex_analysis_data"
python ./TQR_Applications/windows_jobs/app/weekly_get_cex_analysis_data.py >> D:/crypto_quant/logs/weekly_get_cex_analysis_data_%log_date%.txt 2>&1

echo "10: weekly_report_data_sending"
python ./TQR_Applications/windows_jobs/app/weekly_report_data_sending.py >> D:/crypto_quant/logs/weekly_report_data_sending_%log_date%.txt 2>&1